<template>
  <el-container class="Home_Style">
    <!-- 头部区域 -->
    <el-header>
      <span>家族族谱管理系统</span>
      <el-button @click='logout()' type="info">退出</el-button>
    </el-header>
    <!-- 页面主题 -->
    <el-container>
      <!-- 侧边栏 -->
      <el-aside width="200px">
        <!-- 侧边栏菜单区域 -->
        <el-menu background-color="#224b8f" text-color="#fff" active-text-color="#ffd04b" :unique-opened="true"
          :router="true">
          <!-- 数据登记 -->
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-setting"></i>
              <span>数据登记</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/userform">家庭成员信息登记单</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <el-menu-item index="/relationForm">家庭关系信息登记单</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 数据查询 -->
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-setting"></i>
              <span>数据查询</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/userquery">家庭成员信息</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <el-menu-item index="/relationQuery">家庭成员关系</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>
      <!-- 页面主体 -->
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  methods: {
    logout() {
      this.$router.push('/login')
    }
  }
}
</script>

<style>
.Home_Style {
  height: 100%;
}

.el-header {
  background-color: #aac0f3;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 25px;
}

.el-aside {
  background-color: #add2f1;
  color: #FFFFFF;
}

.el-main {
  background-color: #f3f3f3;
}
</style>
